<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>Class SortedListUtil | HiAPI-C# 2025 </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="Class SortedListUtil | HiAPI-C# 2025 ">
      
      <meta name="description" content="Utility class providing extension methods for SortedList operations.">
      <link rel="icon" href="../img/HiAPI.favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
      <meta name="loc:inThisArticle" content="In this article">
      <meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
      <meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
      <meta name="loc:tocFilter" content="Filter by title">
      <meta name="loc:nextArticle" content="Next">
      <meta name="loc:prevArticle" content="Previous">
      <meta name="loc:themeLight" content="Light">
      <meta name="loc:themeDark" content="Dark">
      <meta name="loc:themeAuto" content="Auto">
      <meta name="loc:changeTheme" content="Change theme">
      <meta name="loc:copy" content="Copy">
      <meta name="loc:downloadPdf" content="Download PDF">

      <script type="module" src="./../public/docfx.min.js"></script>

      <script>
        const theme = localStorage.getItem('theme') || 'auto'
        document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
      </script>

  </head>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
            
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Hi.Common.Collections.SortedListUtil">



  <h1 id="Hi_Common_Collections_SortedListUtil" data-uid="Hi.Common.Collections.SortedListUtil" class="text-break">
Class SortedListUtil  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Common.html">Common</a>.<a class="xref" href="Hi.Common.Collections.html">Collections</a></dd></dl>
  <dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
  </div>

  <div class="markdown summary"><p>Utility class providing extension methods for SortedList operations.</p>
</div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class SortedListUtil</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>Inheritance</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><span class="xref">SortedListUtil</span></div>
    </dd>
  </dl>



  <dl class="typelist inheritedMembers">
    <dt>Inherited Members</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
    </div>
  </dd></dl>






  <h2 class="section" id="methods">Methods
</h2>


  <a id="Hi_Common_Collections_SortedListUtil_GetByMethod_" data-uid="Hi.Common.Collections.SortedListUtil.GetByMethod*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetByMethod__2_System_Collections_Generic_SortedList___0___1____0_Hi_Common_Collections_SortedListUtil_SearchMethod___1__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetByMethod``2(System.Collections.Generic.SortedList{``0,``1},``0,Hi.Common.Collections.SortedListUtil.SearchMethod,``1@,System.Int32,System.Int32)">
  GetByMethod&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, SearchMethod, out V, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Get value by <code class="paramref">searchMethod</code>.
If return value is <a class="xref" href="Hi.Common.BinarySearchResult.html#Hi_Common_BinarySearchResult_NotExisted">NotExisted</a>, <code class="paramref">resultValue</code> will be the default value of <code class="typeparamref">V</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetByMethod&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, SortedListUtil.SearchMethod searchMethod, out V resultValue, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>source</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>key</p>
</dd>
    <dt><code>searchMethod</code> <a class="xref" href="Hi.Common.Collections.SortedListUtil.html">SortedListUtil</a>.<a class="xref" href="Hi.Common.Collections.SortedListUtil.SearchMethod.html">SearchMethod</a></dt>
    <dd><p>search method</p>
</dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd><p>searched value</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>search result</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>Key type</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>Value type</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetCeilListIndex_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeilListIndex*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetCeilListIndex__2_System_Collections_Generic_SortedList___0___1____0_System_Int32__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeilListIndex``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Int32@,System.Int32,System.Int32)">
  GetCeilListIndex&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the index of the element in a sorted list that has a key greater than or equal to a specified key.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetCeilListIndex&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out int resultListIndex, int beginListIndex = 0, int endListIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>The key to search for.</p>
</dd>
    <dt><code>resultListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>When this method returns, contains the index of the ceiling element if found; otherwise, -1.</p>
</dd>
    <dt><code>beginListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>endListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>A value indicating whether an exact match was found, a ceiling value was found, or no suitable element exists.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the sorted list.</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetCeil_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeil*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetCeil__2_System_Collections_Generic_SortedList___0___1____0___1__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeil``2(System.Collections.Generic.SortedList{``0,``1},``0,``1@,System.Int32,System.Int32)">
  GetCeil&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out V, int, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetCeil&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out V resultValue, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd></dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd></dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd></dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd></dd>
    <dt><code>V</code></dt>
    <dd></dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetCeil_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeil*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetCeil__2_System_Collections_Generic_SortedList___0___1____0___1__System_Int32__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetCeil``2(System.Collections.Generic.SortedList{``0,``1},``0,``1@,System.Int32@,System.Int32,System.Int32)">
  GetCeil&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out V, out int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Get ceil value by <code class="paramref">key</code>.
If return value is <a class="xref" href="Hi.Common.BinarySearchResult.html#Hi_Common_BinarySearchResult_NotExisted">NotExisted</a>, <code class="paramref">resultValue</code> will be the default value of <code class="typeparamref">V</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetCeil&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out V resultValue, out int ceilIndex, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>source</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>key</p>
</dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd><p>ceil value</p>
</dd>
    <dt><code>ceilIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>search result</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>Key type</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>Value type</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetEnumerableByKeyBoundary_" data-uid="Hi.Common.Collections.SortedListUtil.GetEnumerableByKeyBoundary*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetEnumerableByKeyBoundary__2_System_Collections_Generic_SortedList___0___1____0_System_Boolean___0_System_Boolean_System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetEnumerableByKeyBoundary``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Boolean,``0,System.Boolean,System.Int32,System.Int32)">
  GetEnumerableByKeyBoundary&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, bool, TKey, bool, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets a sequence of key-value pairs from a sorted list within a specified key range.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static IEnumerable&lt;KeyValuePair&lt;TKey, V&gt;&gt; GetEnumerableByKeyBoundary&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey begin, bool isIncludingBeginFloor, TKey end, bool isIncludingEndCeil, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>begin</code> <span class="xref">TKey</span></dt>
    <dd><p>The beginning key of the range.</p>
</dd>
    <dt><code>isIncludingBeginFloor</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the floor value of the beginning key.</p>
</dd>
    <dt><code>end</code> <span class="xref">TKey</span></dt>
    <dd><p>The ending key of the range.</p>
</dd>
    <dt><code>isIncludingEndCeil</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the ceiling value of the ending key.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, V&gt;&gt;</dt>
    <dd><p>A sequence of key-value pairs within the specified range.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the sorted list.</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetFloorBySeek_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorBySeek*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetFloorBySeek__2_System_Collections_Generic_SortedList___0___1____0___1__System_Int32__System_Int32_Hi_Common_Collections_SortedListUtil_SeekDirection_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorBySeek``2(System.Collections.Generic.SortedList{``0,``1},``0,``1@,System.Int32@,System.Int32,Hi.Common.Collections.SortedListUtil.SeekDirection)">
  GetFloorBySeek&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out V, out int, int, SeekDirection)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetFloorBySeek&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out V floorValue, out int floorListIndex, int startListIndex, SortedListUtil.SeekDirection seekDirection = SeekDirection.Free) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd></dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd></dd>
    <dt><code>floorValue</code> <span class="xref">V</span></dt>
    <dd></dd>
    <dt><code>floorListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>startListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>seekDirection</code> <a class="xref" href="Hi.Common.Collections.SortedListUtil.html">SortedListUtil</a>.<a class="xref" href="Hi.Common.Collections.SortedListUtil.SeekDirection.html">SeekDirection</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd></dd>
    <dt><code>V</code></dt>
    <dd></dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetFloorListIndexBySeek_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorListIndexBySeek*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetFloorListIndexBySeek__2_System_Collections_Generic_SortedList___0___1____0_System_Int32__System_Int32_Hi_Common_Collections_SortedListUtil_SeekDirection_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorListIndexBySeek``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Int32@,System.Int32,Hi.Common.Collections.SortedListUtil.SeekDirection)">
  GetFloorListIndexBySeek&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out int, int, SeekDirection)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetFloorListIndexBySeek&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out int floorListIndex, int startListIndex, SortedListUtil.SeekDirection seekDirection = SeekDirection.Free) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd></dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd></dd>
    <dt><code>floorListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>startListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>seekDirection</code> <a class="xref" href="Hi.Common.Collections.SortedListUtil.html">SortedListUtil</a>.<a class="xref" href="Hi.Common.Collections.SortedListUtil.SeekDirection.html">SeekDirection</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd></dd>
    <dt><code>V</code></dt>
    <dd></dd>
  </dl>






  <h4 class="section" id="Hi_Common_Collections_SortedListUtil_GetFloorListIndexBySeek__2_System_Collections_Generic_SortedList___0___1____0_System_Int32__System_Int32_Hi_Common_Collections_SortedListUtil_SeekDirection__remarks">Remarks</h4>
  <div class="markdown level1 remarks"><p>The <a class="xref" href="Hi.Common.Collections.SortedListUtil.SeekDirection.html#Hi_Common_Collections_SortedListUtil_SeekDirection_Free">Free</a> seek direction does not loss additional performance.
The seek direction only effect the resulting value by the <code class="paramref">startListIndex</code> bound.</p>
</div>




  <a id="Hi_Common_Collections_SortedListUtil_GetFloorListIndex_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorListIndex*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetFloorListIndex__2_System_Collections_Generic_SortedList___0___1____0_System_Int32__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloorListIndex``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Int32@,System.Int32,System.Int32)">
  GetFloorListIndex&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the index of the element in a sorted list that has a key less than or equal to a specified key.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetFloorListIndex&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out int resultListIndex, int beginListIndex = 0, int endListIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>The key to search for.</p>
</dd>
    <dt><code>resultListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>When this method returns, contains the index of the floor element if found; otherwise, -1.</p>
</dd>
    <dt><code>beginListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>endListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>A value indicating whether an exact match was found, a floor value was found, or no suitable element exists.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the sorted list.</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetFloor_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloor*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetFloor__2_System_Collections_Generic_SortedList___0___1____0___1__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloor``2(System.Collections.Generic.SortedList{``0,``1},``0,``1@,System.Int32,System.Int32)">
  GetFloor&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out V, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Get floor value by <code class="paramref">key</code>.
If return value is <a class="xref" href="Hi.Common.BinarySearchResult.html#Hi_Common_BinarySearchResult_NotExisted">NotExisted</a>, <code class="paramref">resultValue</code> will be the default value of <code class="typeparamref">V</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetFloor&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out V resultValue, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>source</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>key</p>
</dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd><p>floor value</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>search result</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>Key type</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>Value type</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetFloor_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloor*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetFloor__2_System_Collections_Generic_SortedList___0___1____0___1__System_Int32__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetFloor``2(System.Collections.Generic.SortedList{``0,``1},``0,``1@,System.Int32@,System.Int32,System.Int32)">
  GetFloor&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, out V, out int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Get floor value by <code class="paramref">key</code>.
If return value is <a class="xref" href="Hi.Common.BinarySearchResult.html#Hi_Common_BinarySearchResult_NotExisted">NotExisted</a>, <code class="paramref">resultValue</code> will be the default value of <code class="typeparamref">V</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetFloor&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey key, out V resultValue, out int floorIndex, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>source</p>
</dd>
    <dt><code>key</code> <span class="xref">TKey</span></dt>
    <dd><p>key</p>
</dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd><p>floor value</p>
</dd>
    <dt><code>floorIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>search result</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>Key type</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>Value type</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetIndexRangeByKeyBoundary_" data-uid="Hi.Common.Collections.SortedListUtil.GetIndexRangeByKeyBoundary*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetIndexRangeByKeyBoundary__2_System_Collections_Generic_SortedList___0___1____0_System_Boolean___0_System_Boolean_System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetIndexRangeByKeyBoundary``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Boolean,``0,System.Boolean,System.Int32,System.Int32)">
  GetIndexRangeByKeyBoundary&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, bool, TKey, bool, int, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Range&lt;int&gt; GetIndexRangeByKeyBoundary&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey begin, bool isIncludingBeginFloor, TKey end, bool isIncludingEndCeil, int beginListIndex = 0, int endListIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd></dd>
    <dt><code>begin</code> <span class="xref">TKey</span></dt>
    <dd></dd>
    <dt><code>isIncludingBeginFloor</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
    <dt><code>end</code> <span class="xref">TKey</span></dt>
    <dd></dd>
    <dt><code>isIncludingEndCeil</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
    <dt><code>beginListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>endListIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.Range-1.html">Range</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>&gt;</dt>
    <dd></dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd></dd>
    <dt><code>V</code></dt>
    <dd></dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetNearestIndex_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestIndex*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetNearestIndex__1_System_Collections_Generic_SortedList_System_Double___0__System_Double_System_Int32__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestIndex``1(System.Collections.Generic.SortedList{System.Double,``0},System.Double,System.Int32@,System.Int32,System.Int32)">
  GetNearestIndex&lt;V&gt;(SortedList&lt;double, V&gt;, double, out int, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the index of the element in a sorted list that has a key nearest to a specified key.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetNearestIndex&lt;V&gt;(this SortedList&lt;double, V&gt; src, double key, out int resultIndex, int beginIndex = 0, int endIndex = -1)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>key</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
    <dd><p>The key to search for.</p>
</dd>
    <dt><code>resultIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>When this method returns, contains the index of the nearest element if found; otherwise, -1.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>A value indicating whether an exact match was found, or the nearest floor/ceiling value.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetNearestKey_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestKey*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetNearestKey__1_System_Collections_Generic_SortedList_System_Double___0__System_Double_System_Double__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestKey``1(System.Collections.Generic.SortedList{System.Double,``0},System.Double,System.Double@,System.Int32,System.Int32)">
  GetNearestKey&lt;V&gt;(SortedList&lt;double, V&gt;, double, out double, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the key in a sorted list that is nearest to a specified key.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetNearestKey&lt;V&gt;(this SortedList&lt;double, V&gt; src, double key, out double resultKey, int beginIndex = 0, int endIndex = -1)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>key</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
    <dd><p>The key to search for.</p>
</dd>
    <dt><code>resultKey</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
    <dd><p>When this method returns, contains the nearest key if found; otherwise, NaN.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>A value indicating whether an exact match was found, or the nearest floor/ceiling value.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetNearestValue_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestValue*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetNearestValue__1_System_Collections_Generic_SortedList_System_Double___0__System_Double___0__System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetNearestValue``1(System.Collections.Generic.SortedList{System.Double,``0},System.Double,``0@,System.Int32,System.Int32)">
  GetNearestValue&lt;V&gt;(SortedList&lt;double, V&gt;, double, out V, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets the value in a sorted list that corresponds to the key nearest to a specified key.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static BinarySearchResult GetNearestValue&lt;V&gt;(this SortedList&lt;double, V&gt; src, double key, out V resultValue, int beginIndex = 0, int endIndex = -1)</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>key</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
    <dd><p>The key to search for.</p>
</dd>
    <dt><code>resultValue</code> <span class="xref">V</span></dt>
    <dd><p>When this method returns, contains the value corresponding to the nearest key if found; otherwise, the default value for the type.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="Hi.Common.BinarySearchResult.html">BinarySearchResult</a></dt>
    <dd><p>A value indicating whether an exact match was found, or the nearest floor/ceiling value.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetSortedListByKeyBoundary_" data-uid="Hi.Common.Collections.SortedListUtil.GetSortedListByKeyBoundary*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetSortedListByKeyBoundary__2_System_Collections_Generic_SortedList___0___1____0_System_Boolean___0_System_Boolean_System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetSortedListByKeyBoundary``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Boolean,``0,System.Boolean,System.Int32,System.Int32)">
  GetSortedListByKeyBoundary&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, bool, TKey, bool, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Creates a new sorted list containing key-value pairs from a source sorted list within a specified key range.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static SortedList&lt;TKey, V&gt; GetSortedListByKeyBoundary&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey begin, bool isIncludingBeginFloor, TKey end, bool isIncludingEndCeil, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>begin</code> <span class="xref">TKey</span></dt>
    <dd><p>The beginning key of the range.</p>
</dd>
    <dt><code>isIncludingBeginFloor</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the floor value of the beginning key.</p>
</dd>
    <dt><code>end</code> <span class="xref">TKey</span></dt>
    <dd><p>The ending key of the range.</p>
</dd>
    <dt><code>isIncludingEndCeil</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the ceiling value of the ending key.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>A new sorted list containing key-value pairs within the specified range.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the sorted list.</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_GetValuesByKeyBoundary_" data-uid="Hi.Common.Collections.SortedListUtil.GetValuesByKeyBoundary*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_GetValuesByKeyBoundary__2_System_Collections_Generic_SortedList___0___1____0_System_Boolean___0_System_Boolean_System_Int32_System_Int32_" data-uid="Hi.Common.Collections.SortedListUtil.GetValuesByKeyBoundary``2(System.Collections.Generic.SortedList{``0,``1},``0,System.Boolean,``0,System.Boolean,System.Int32,System.Int32)">
  GetValuesByKeyBoundary&lt;TKey, V&gt;(SortedList&lt;TKey, V&gt;, TKey, bool, TKey, bool, int, int)
  
  </h3>

  <div class="markdown level1 summary"><p>Gets a list of values from a sorted list within a specified key range.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static List&lt;V&gt; GetValuesByKeyBoundary&lt;TKey, V&gt;(this SortedList&lt;TKey, V&gt; src, TKey begin, bool isIncludingBeginFloor, TKey end, bool isIncludingEndCeil, int beginIndex = 0, int endIndex = -1) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, V&gt;</dt>
    <dd><p>The source sorted list.</p>
</dd>
    <dt><code>begin</code> <span class="xref">TKey</span></dt>
    <dd><p>The beginning key of the range.</p>
</dd>
    <dt><code>isIncludingBeginFloor</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the floor value of the beginning key.</p>
</dd>
    <dt><code>end</code> <span class="xref">TKey</span></dt>
    <dd><p>The ending key of the range.</p>
</dd>
    <dt><code>isIncludingEndCeil</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd><p>Whether to include the ceiling value of the ending key.</p>
</dd>
    <dt><code>beginIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The starting index for the search range (inclusive). Default is 0.</p>
</dd>
    <dt><code>endIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd><p>The ending index for the search range (exclusive). Default is -1, which means the end of the list.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;V&gt;</dt>
    <dd><p>A list of values within the specified range.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the sorted list.</p>
</dd>
    <dt><code>V</code></dt>
    <dd><p>The type of values in the sorted list.</p>
</dd>
  </dl>










  <a id="Hi_Common_Collections_SortedListUtil_ToSortedList_" data-uid="Hi.Common.Collections.SortedListUtil.ToSortedList*"></a>

  <h3 id="Hi_Common_Collections_SortedListUtil_ToSortedList__2_System_Collections_Generic_List___1__System_Func___1___0__" data-uid="Hi.Common.Collections.SortedListUtil.ToSortedList``2(System.Collections.Generic.List{``1},System.Func{``1,``0})">
  ToSortedList&lt;TKey, TValue&gt;(List&lt;TValue&gt;, Func&lt;TValue, TKey&gt;)
  
  </h3>

  <div class="markdown level1 summary"><p>Converts a list of values to a sorted list using a key selector function.</p>
</div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static SortedList&lt;TKey, TValue&gt; ToSortedList&lt;TKey, TValue&gt;(this List&lt;TValue&gt; src, Func&lt;TValue, TKey&gt; keyFunc) where TKey : IComparable&lt;TKey&gt;</code></pre>
  </div>

  <h4 class="section">Parameters</h4>
  <dl class="parameters">
    <dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;TValue&gt;</dt>
    <dd><p>The source list of values.</p>
</dd>
    <dt><code>keyFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;TValue, TKey&gt;</dt>
    <dd><p>A function to extract a key from each value.</p>
</dd>
  </dl>

  <h4 class="section">Returns</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sortedlist-2">SortedList</a>&lt;TKey, TValue&gt;</dt>
    <dd><p>A sorted list containing the values from the source list, keyed by the extracted keys.</p>
</dd>
  </dl>

  <h4 class="section">Type Parameters</h4>
  <dl class="parameters">
    <dt><code>TKey</code></dt>
    <dd><p>The type of keys in the resulting sorted list.</p>
</dd>
    <dt><code>TValue</code></dt>
    <dd><p>The type of values in the list and the resulting sorted list.</p>
</dd>
  </dl>











</article>

        <div class="contribution d-print-none">
        </div>


      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top text-secondary">
      <div class="container-xxl">
        <div class="flex-fill">
          <span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
        </div>
      </div>
    </footer>
  </body>
</html>
